package org.example.base.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.example.base.entity.group.Update;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Data
@Schema(description = "请求对象")
public class Request<T> implements Serializable {
    private static final long serialVersionUID = 1960936544757256569L;
    /**
     * 请求id
     */
    @Schema(description = "请求id")
    private String traceId;
    /**
     * 请求数据
     */
    @Valid
    @Schema(description = "请求数据")
    @NotNull(groups = {Update.class})
    private T data;

    /**
     * 请求版本
     */
    @Schema(description = "请求版本")
    private String version;
    /**
     * 请求时间戳
     */
    @Schema(description = "请求时间戳")
    private Long timestamp;
    /**
     * 请求签名
     */
    @Schema(description = "请求签名")
    private String sign;

}
